<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    isActive: Boolean,
    text: String,
  },
});
</script>

<template>
  <view
    class="tab-item"
    :style="{ backgroundColor: isActive ? '#ffffff' : '' }"
  >
    <view class="tab-item-line" v-if="isActive"></view>
    <view class="tab-item-text" :style="{ color: isActive ? '#ff7900' : '' }">
      {{ text }}
    </view>
  </view>
</template>

<style lang="scss">
.tab-item {
  position: relative;
  padding-left: 46rpx;

  .tab-item-line {
    position: absolute;
    left: 0;
    top: 50%;
    width: 6rpx;
    height: 36rpx;
    border-radius: 0 6rpx 6rpx 0;
    background-color: #ff7900;
    transform: translateY(-50%);
  }

  .tab-item-text {
    font-size: 28rpx;
    color: #999999;
    line-height: 100rpx;
  }
}
</style>